This application is related to coassigned application Ser. No. 09/012,813 now U.S. Pat. No. 6,182,203 filed contemporaneously herewith and incorporated herein by reference.
This invention relates to apparatus and techniques for manipulation and generation of Boolean values and for conditioning operations in a microprocessor.
Microprocessors, such as general purpose microprocessors, digital signal processors, and the like, typically include an arithmetic logic unit (xe2x80x9cALUxe2x80x9d) and a set of registers, sometimes referred to as general purpose registers (xe2x80x9cGPRsxe2x80x9d), where the operands to be operated on by the ALU can be accessed by the ALU, either immediately or one or more cycles later, in an ALU operation, and where the results of ALU operations can be immediately stored in an ALU operation.
In addition to the operations of addition and subtraction, ALUs may also have the capability of performing Boolean operations, such as compare, logical OR, bitwise OR, AND, or the like. The results of such operations, Boolean values, are typically stored in a register separate from the GPRs, for example in a status register. However, the Boolean values thus stored are not as accessible to the ALU as values stored in a GPR and require several instructions to test the resulting Boolean values. In other words, more processor cycles are needed to, for example, to present such Boolean values to the ALU as an input, should it be desired to do so in order to conditionally execute a later instruction, as compared with presenting a GPR value as an input to the ALU, which is typically done in the same clock cycle in which the ALU operation is performed.
An object of the present invention is improve the way in which instruction in a microprocessor are conditionally executed.
The present invention provides a general purpose microprocessor architecture enabling more efficient computations of a type in which Boolean operations and arithmetic operations conditioned on the results of the Boolean operations are interleaved. The microprocessor is provided with a plurality of general purpose registers (xe2x80x9cGPRsxe2x80x9d)and an arithmetic logic unit (xe2x80x9cALUxe2x80x9d), capable of performing arithmetic operations and Boolean operations. The ALU has a first input and a second input, and an output, the first and second inputs receiving values stored in the GPRs. The output stores the results of the arithmetic logic unit operations in the GPRs. At least one of the GPRs is capable of receiving directly from the ALU a result of a Boolean operation.
In one embodiment, at least one of the GPRs capable of receiving directly from the ALU a result of a Boolean operation is configured so as to cause the conditioning of an arithmetic operation of the ALU based on the value stored in the GPR.
A method is also provided, performed in a microprocessor having such an architecture, in which a Boolean operation is performed in the ALU to obtain thereby a Boolean value representing the result of the Boolean operation. The Boolean value is stored in a first general purpose register in the same clock cycle as that in which the Boolean operation is performed. Thereafter, an arithmetic operation is performed in the arithmetic logic unit and the result of the arithmetic operation is stored in a second general purpose register. However, the step of performing/storing is conditioned on the Boolean value stored in the first general purpose register.
These and other features of the invention will be apparent to those skilled in the art from the following detailed description of the invention, taken together with the accompanying drawings.